package com.java.al.beanutils.entity;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

public class ForRun {

	public static void main(String[] args) throws IllegalAccessException, InvocationTargetException {
		SourceEntity source = new SourceEntity();
		DaJiangYou djy = new DaJiangYou();
		djy.setNengli("打酱油");
		source.setChang("长");
		source.setDjy(djy);
		TargetEntity target = new TargetEntity();
		source.setName("小名");
		source.setSex("男");
		
		BeanUtils.copyProperties(target, source);
//		BeanUtils.
		System.out.println(source.getName());
		System.out.println(source.getDjy().getNengli());
		System.out.println(target.getName());
		System.out.println(target.getChang());
		System.out.println(target.getKuan());
	}

}
